<template>
  <div>
    <div class="headerBox">
      <homeHeader></homeHeader>
    </div>

    <div class="contentBox">
      <div class="content clear">
        <div class="content-left">
          <h2 class="left-h2">
            正在热播（41部）<span class="left-span"
              >全部<i class="el-icon-arrow-right"></i
            ></span>
          </h2>
          <div class="content-msg">
            <div
              class="movie-item"
              v-for="(item, index) in seedingList"
              @click="toFilmDetail(1)"
              :key="index"
            >
              <div class="movie-poster">
                <img
                  src="https://p0.meituan.net/movie/df84690ded848edf709187eae23a7969866455.jpg@160w_220h_1e_1c"
                  alt=""
                />
                <div class="movie-poster-p">
                  <p>
                    {{ item.filmName }}
                    <span> {{ item.filmTop }} </span>
                  </p>
                </div>
                <div class="movie-overlay-bg"></div>
              </div>
              <div class="movie-detail" @click.stop="toCinemas">购&nbsp;票</div>
            </div>
          </div>
          <h2 class="comingSoon">
            即将上映（47部）<span class="left-span"
              >全部<i class="el-icon-arrow-right"></i
            ></span>
          </h2>
          <div class="comingSoon-msg">
            <div
              class="comingSoon-item"
              v-for="(item, index) in seedingList"
              @click="toFilmDetail(2)"
              :key="index"
            >
              <div class="movie-poster">
                <img
                  src="https://p0.meituan.net/movie/df84690ded848edf709187eae23a7969866455.jpg@160w_220h_1e_1c"
                  alt=""
                />
                <div class="movie-poster-p">
                  <p>
                    {{ item.filmName }}
                    <span> {{ item.filmTop }}</span>
                  </p>
                </div>
                <div class="movie-overlay-bg"></div>
              </div>
              <div class="movie-wish">1234人想看</div>
              <div class="movie-detail-strong">
                <div class="movie-detail-strong-left">预告片</div>
                <div class="movie-detail-strong-right">预售</div>
              </div>
              <p class="Release">12月25号上映</p>
              <div class="movie-ver">
                <span class="m3d"></span>
              </div>
            </div>
          </div>
          <h2 class="hitMovies">
            热播电影
            <span class="hitMovies-span">爱情</span>
            <span class="hitMovies-span">喜剧</span>
            <span class="hitMovies-span">动作</span>
            <span class="hitMovies-span">恐怖</span>
            <span class="hitMovies-span">动画</span>
            <span class="left-span"
              >全部<i class="el-icon-arrow-right"></i
            ></span>
          </h2>
          <div class="hitMovies-msg">
            <div
              class="movie-poster"
              @click="toFilmDetail(3)"
              v-for="item in 7"
              :key="item"
            >
              <img
                src="https://p0.meituan.net/movie/df84690ded848edf709187eae23a7969866455.jpg@160w_220h_1e_1c"
                alt=""
              />
              <div class="movie-poster-p">
                <p>
                  送你一朵小红花
                  <span> 9.2 </span>
                </p>
              </div>
              <div class="movie-overlay-bg"></div>
            </div>
          </div>
        </div>
        <div class="content-right">
          <h2 class="today">今日票房</h2>
          <div class="panel-content">
            <ul class="ranking-wrapper">
              <li>
                <img
                  src="https://p0.meituan.net/movie/3334cd970d6cb080c1491d0baf08e4731724834.jpg@120w_80h_1e_1c"
                  alt=""
                />
                &nbsp;神奇女侠1984
                <p class="liP">1254.12万</p>
              </li>
              <li v-for="(item, index) in todayList" :key="index">
                2&nbsp;{{ item.filmName }} <span class="liSpan">1869.97万</span>
              </li>
              <!-- <li>3&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li>
              <li>4&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li>
              <li>5&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li> -->
            </ul>
          </div>
          <h2 class="popular">
            最受期待
            <span>查看完整表单<i class="el-icon-arrow-right"></i></span>
          </h2>
          <div class="panel-content">
            <ul class="ranking-wrapper">
              <li>
                <img
                  src="https://p0.meituan.net/movie/3334cd970d6cb080c1491d0baf08e4731724834.jpg@120w_80h_1e_1c"
                  alt=""
                />
                &nbsp;神奇女侠1984
                <p class="liP">1254.12万</p>
              </li>
              <li v-for="(item, index) in todayList" :key="index">
                2&nbsp;{{ item.filmName }} <span class="liSpan">1869.97万</span>
              </li>
              <!-- <li>3&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li>
              <li>4&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li>
              <li>5&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span></li> -->
            </ul>
          </div>
          <h2 class="popular">
            TOP100<span>查看完整表单<i class="el-icon-arrow-right"></i></span>
          </h2>
          <div class="panel-content">
            <ul class="ranking-wrapper">
              <li>
                <img
                  src="https://p0.meituan.net/movie/3334cd970d6cb080c1491d0baf08e4731724834.jpg@120w_80h_1e_1c"
                  alt=""
                />
                &nbsp;神奇女侠1984
                <p class="liP">1254.12万</p>
              </li>
              <li v-for="item in 9" :key="item">
                2&nbsp;神奇女侠1984 <span class="liSpan">1869.97万</span>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <homeFooter></homeFooter>
  </div>
</template>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
//头部
.headerBox {
  width: 100%;
  height: 80px;
  border-bottom: 1px solid #d8d8d8;
}

.header {
  width: 1200px;
  height: 80px;
  /* background: aqua; */
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.headerLog {
  width: 133px;
  height: 80px;
  display: table;
  overflow: hidden;
  img {
    margin-top: 20px;
  }
}

.headerCity {
  height: 80px;
  line-height: 80px;
  font-size: 16px;
}

.headerCityArrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 5px solid #666;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

.headerNav {
  width: 490px;
  height: 80px;
}

.headerNav ul {
  display: flex;
  justify-content: space-between;
  align-items: center;

  .active {
    color: #fff;
    background: #ef4238;
  }
}

.headerNav li {
  width: 70px;
  height: 80px;
  line-height: 80px;
  text-align: center;
  font-size: 18px;
}
.headerNav li:hover {
  color: #ef4238;
}
.headerNav ul .active:hover {
  color: #fff;
}

.app-download {
  width: 132px;
  height: 80px;
  font-size: 16px;
  color: #000;
  text-align: center;
  position: relative;

  .el-icon-mobile-phone {
    font-size: 20px;
  }
  .app-download-box {
    // display: none;
    display: none;
    width: 130px;
    height: 165px;
    position: absolute;
    left: 0;
    top: 80px;
    background-color: #fff;

    // background-image: url(app-link-icon.3bc8fd3….png);
    // background-position: 24px 14px;
    // background-size: 82px 82px;
    background-repeat: no-repeat;
    border: 1px solid #dcd4d7;
    border-top: 0;
    img {
      width: 82px;
      height: 82px;
    }
    .down-content {
      margin-top: 10px;
      font-size: 14px;
      color: #999;
    }
  }
  a {
    display: inline-block;
    line-height: 80px;
    color: #000;
    z-index: 999;
    position: absolute;
    left: 0;
    top: 0;
  }
}
.app-download:hover .app-download-box {
  display: block;
}
.earch {
  width: 220px;
  height: 40px;
  position: relative;
  .earchIput {
    display: inline-block;
    height: 40px;
    line-height: 1.2;
    width: 220px;
    padding: 0 40px 0 20px;
    border: 1px solid #ccc;
    font-size: 14px;
    border-radius: 30px;
    background-color: #faf8fa;
    overflow: hidden;
    color: #333;
  }
  .submit {
    display: inline-block;
    position: absolute;
    left: 180px;
    top: 0;
    height: 40px;
    width: 40px;
    background-color: #ef4238;
    border-radius: 30px;
    background-image: url();
    cursor: pointer;
    border: none;
  }
}

.mine {
  width: 78px;
  height: 80px;
  line-height: 80px;
  text-align: center;
  position: relative;
  .mine_img {
    width: 100%;
    height: 100%;
    // z-index: 99;
    position: absolute;
    top: 0;
    left: 0;
  }
  .user-menu {
    display: none;
    width: 100%;
    position: absolute;
    right: 0;
    top: 80px;
    border: 1px solid #d8d8d8;
    border-top: 0;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    z-index: 999;
  }
}
.mine:hover .user-menu {
  display: block;
}
.headerCityArrow {
  transition: all 0.2s ease;
}

.mine img {
  width: 40px;
  height: 40px;
  vertical-align: middle;
}
.contentBox {
  width: 100%;
  padding-top: 60px;
  .content {
    width: 1178px;

    margin: 0 auto;

    .content-left {
      width: 750px;

      // position: absolute;
      // left: 0;
      // top: 0;
      float: left;
      overflow: hidden;
      .left-h2 {
        color: #ef4238;
        font-size: 26px;
        font-weight: 400;
        line-height: 32px;
        .left-span {
          font-size: 14px;
          line-height: 20px;
          float: right;
          margin-top: 10px;
        }
      }
      .content-msg {
        width: 100%;
        margin-top: 32px;
        display: flex;
        flex-flow: wrap;
        justify-content: space-between;
        .movie-item {
          width: 160px;
          height: 260px;
          border: 1px solid #efefef;
          margin-bottom: 30px;
          .movie-poster {
            width: 100%;
            height: 220px;
            position: relative;
            img {
              width: 100%;
              height: 100%;
            }
            .movie-overlay-bg {
              width: 100%;
              height: 100%;
              position: absolute;
              left: 0;
              top: 0;
              background: url() repeat-x bottom;
            }
            .movie-poster-p {
              position: absolute;
              left: 0;
              bottom: 10px;
              width: 100%;
              padding: 0 5px;
              box-sizing: border-box;
              z-index: 999;
              p {
                color: #fff;
                font-size: 16px;
                line-height: 22px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                span {
                  color: #ffb400;
                  float: right;
                }
              }
            }
          }
          .movie-detail {
            width: 100%;
            height: 39px;
            line-height: 39px;
            text-align: center;
            color: #ef4238;
            font-size: 14px;
            background: #fff;
          }
          .movie-detail:hover {
            color: #fff;
            background-color: #ef4238;
          }
        }
      }
      .comingSoon {
        @extend .left-h2;
        color: #2d98f3;
        margin-bottom: 32px;
      }
      .comingSoon-msg {
        width: 100%;
        display: flex;
        flex-flow: wrap;
        justify-content: space-between;
        .comingSoon-item {
          width: 160px;
          height: 295px;
          border: 1px solid #efefef;
          margin-bottom: 70px;
          position: relative;
          .movie-poster {
            width: 100%;
            height: 220px;
            position: relative;
            img {
              width: 100%;
              height: 100%;
            }
            .movie-overlay-bg {
              width: 100%;
              height: 100%;
              position: absolute;
              left: 0;
              top: 0;
              background: url() repeat-x bottom;
            }
            .movie-poster-p {
              position: absolute;
              left: 0;
              bottom: 10px;
              width: 100%;
              padding: 0 5px;
              box-sizing: border-box;
              z-index: 999;
              p {
                color: #fff;
                font-size: 16px;
                line-height: 22px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                span {
                  color: #ffb400;
                  float: right;
                }
              }
            }
          }
          .movie-wish {
            font-size: 14px;
            color: #ffb400;
            background-color: #fbfbfb;
            text-align: left;
            padding-left: 10px;
            height: 35px;
            line-height: 35px;
          }
          .movie-detail-strong {
            width: 100%;
            height: 40px;
            font-size: 14px;
            background: #fff;
            .movie-detail-strong-left {
              width: 50%;
              height: 100%;
              float: left;
              color: #999;
              box-sizing: border-box;
              border-right: 1px dotted #e5e5e5;
              text-align: center;
              line-height: 40px;
            }
            .movie-detail-strong-right {
              width: 50%;
              height: 100%;
              float: left;
              text-align: center;
              color: #2d98f3;
              line-height: 40px;
            }
            .movie-detail-strong-right:hover {
              color: #fff;
              background: #2d98f3;
            }
          }
          .Release {
            text-align: center;
            color: #999;
            font-size: 14px;
            line-height: 40px;
          }
          .movie-ver {
            position: absolute;
            top: 4px;
            left: -2px;
            font-size: 12px;
            color: #fff;
            z-index: 200;
            .m3d {
              display: inline-block;
              width: 31px;
              height: 25px;
              background-image: url();
              // background: violet;
            }
          }
        }
      }
      .hitMovies {
        @extend .left-h2;
        color: #ef4238;
        margin-bottom: 30px;
        .hitMovies-span {
          font-size: 14px;
          color: #333;
          padding: 0 8px;
        }
      }
      .hitMovies-msg {
        width: 100%;
        // height: 500px;
        display: flex;
        flex-flow: wrap;
        justify-content: space-between;
        .movie-poster {
          width: 160px;
          height: 220px;
          position: relative;
          margin-bottom: 30px;
          img {
            width: 100%;
            height: 100%;
          }
          .movie-overlay-bg {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            background: url() repeat-x bottom;
          }
          .movie-poster-p {
            position: absolute;
            left: 0;
            bottom: 10px;
            width: 100%;
            padding: 0 5px;
            box-sizing: border-box;
            z-index: 999;
            p {
              color: #fff;
              font-size: 16px;
              line-height: 22px;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              span {
                color: #ffb400;
                float: right;
              }
            }
          }
        }
      }
      .hitMovies-msg div:nth-child(1) {
        width: 356px;
      }
    }
    .content-right {
      width: 360px;
      float: right;
      // position: absolute;
      // top: 0;
      // right: 0;
      .today {
        font-size: 26px;
        font-weight: 400;
        color: #ef4238;
        margin-bottom: 20px;
      }
      .panel-content {
        width: 100%;
        margin-bottom: 30px;
        .ranking-wrapper {
          width: 100%;
          li {
            width: 100%;
            height: 55px;
            line-height: 55px;
            font-size: 18px;
            color: #333;
            .liSpan {
              float: right;
              color: #ef4238;
              font-size: 14px;
            }
          }
          li:nth-child(1) {
            height: 80px;
            margin-bottom: 11px;
            border: 1px solid #efefef;
            img {
              float: left;
              width: 120px;
              height: 80px;
              margin-right: 8px;
            }
            p {
              font-size: 14px;
              color: #ef4238;
              margin-top: -20px;
            }
          }
        }
        .ranking-wrapper li:hover {
          background: #f7f7f7;
        }
      }
      .popular {
        color: #ffb400;
        font-size: 26px;
        font-weight: 400;
        line-height: 32px;
        overflow: hidden;
        margin-bottom: 15px;
        span {
          font-size: 14px;
          line-height: 16px;
          float: right;
          margin-top: 10px;
        }
      }
    }
  }
}
.flooderBox {
  width: 100%;
  margin-top: 82px;
  color: #ccc;
  padding: 56px 0;
  background: #221e22;
  overflow: hidden;
  p {
    text-align: center;
    font-size: 14px;
    line-height: 22px;
    height: 22px;
  }
  p:nth-child(1) {
    span {
      color: #ef4238;
      padding: 0 8px;
    }
  }
  p:nth-child(10) {
    height: 40px;
    margin-top: 20px;
    img:nth-child(2) {
      margin: 0 20px;
    }
  }
}
</style>
<script>
import homeHeader from "../components/home/header";
import homeFooter from "../components/home/homefooter";
import films from "../model/cinemas";
export default {
  data() {
    return {
      // img: ImgInfo.data,
      activeIndex: 1,
      list: [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }],
      seedingList: [],
      todayList: [],
    };
  },
  methods: {
    changeActiveIndex(index) {
      this.activeIndex = index;
    },
    toFilm() {
      this.activeIndex = 2;
    },
    toFilmDetail(id) {
      // alert("111")
      this.$router.push(`films/${id}`);
    },
    toCinemas() {
      // alert("111"),
      this.$router.push("Cinemas/:1");
    },
  },
  created() {
    films.films().then((res) => {
      this.seedingList = res.data.data.list.slice(0, 8);
      // console.log(this.seedingList);
      this.todayList = res.data.data.list.slice(0, 4);
      console.log(this.todayList);
    });
  },
  components: {
    homeHeader,
    homeFooter,
  },
};
</script>
